from flask import current_app
from qiniu import Auth,put_file,etag


# 七牛云上传
def qiniu_token():
    # 获取七牛云token
    ACCESS_KEY = 'L4KBaBkhV52xMvErYgE6XbYDh57uy2qey2qppzRe'
    SECRET_KEY = 'bildAzQKbSmdtnoAe-dUNjeqM7JMqCWaoURqbaCz'
    # 空间名
    BUCKET_NAME = 'hahaha2109'

    q = Auth(ACCESS_KEY, SECRET_KEY)

    # key上传后的文件名
    # key = ''
    token = q.upload_token(BUCKET_NAME)
    return token